<?php

namespace App\Providers;

use Illuminate\Support\ServiceProvider;
use JPush\Client;

class JpushServiceProvider extends ServiceProvider
{
    /**
     * Bootstrap the application services.
     *
     * @return void
     */
    public function boot()
    {
        //
    }

    /**
     * Register the application services.
     *
     * @return void
     */
    public function register()
    {
        $this->app->singleton('Jpush', function ($app) {
            $app_key = config('jpush.app_key');
            $master_secret = config('jpush.master_secret');
            $log_file = config('jpush.log_file');
            $retry_times = config('jpush.retry_times');
            $zone = config('jpush.zone');
            return new Client($app_key, $master_secret, $log_file, $retry_times, $zone);
        });
    }
}
